#include <ObjectInspectorVisitor.h>
#include <iostream>
ObjectInspectorVisitor::ObjectInspectorVisitor()
{
    m_currentItem = NULL;
}

ObjectInspectorVisitor::~ObjectInspectorVisitor()
{

}

void ObjectInspectorVisitor::apply(QStandardItem *item)
{
    std::cout<<"ObjectInspectorVisitor::apply"<<item->text().toStdString()<<std::endl;
}

void ObjectInspectorVisitor::traverse(QStandardItem *item)
{
    if(item == NULL)
        return;
    apply(item);

    m_currentItem = item;

    m_previousItemList.push_back(m_currentItem);
    for(int i = 0; i < item->rowCount(); i++)
    {
        traverse(item->child(i));
    }
    m_previousItemList.pop_back();
}
